function addQuestions() {

    if ($("#indexModeltitle").html()=="添加问题"){
        $("#input-id").val("");
    }

    var id = $("#input-id").val();
    var content = $("#content").val();
    var allrate = $("#all-rate").val();
    var type = $("#selected").val();
    var scope = $("#scope").val();
    var textA = $("#text-a").val();
    var textB = $("#text-b").val();
    var textC = $("#text-c").val();
    var textD = $("#text-d").val();
    var rateA = $("#a-rate").val();
    var rateB = $("#b-rate").val();
    var rateC = $("#c-rate").val();
    var rateD = $("#d-rate").val();
    if (type == 2) {
        var answer = textA + ";" + textB;
        rateC = 0;
        rateD = 0;
    } else {
        var answer = textA + ";" + textB + ";" + textC + ";" + textD;
    }
    $.ajax({
        url: "addQuestion.action",
        type: "post",
        async: "true",
        dataType: "json",
        contentType: "application/x-www-form-urlencoded;charset=utf-8",
        data: {
            "questionsEntity.id": id,
            "questionsEntity.content": content,
            "questionsEntity.kindId": type,
            "questionsEntity.scopeId": scope,
            "questionsEntity.answer": answer,
            "questionsEntity.a": rateA,
            "questionsEntity.b": rateB,
            "questionsEntity.c": rateC,
            "questionsEntity.d": rateD
        },
        success: function (data) {
            alert(data.msg);
            getQuestionsInfo();
        },
        error: function () {
            alert("请求错误");
        }
    })
}